Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hermit

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hermit

Prints html in the terminal using colors and simple layout to reflect the document structure.

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6K
increased by40.18%
Maintainers
1
Weekly downloads
 
Created
Source

hermit build status

Prints html in the terminal using colors and simple layout to reflect the document structure.

Objective

Provide a simple tool to render html in the terminal in a readable format. It is not supposed to replace your browser. The main indended use is to render html snippets, e.g., the ones contained in the descriptions of the json version of the nodejs documentation.

If you want a terminal browser, try lynx instead.

Installation

npm install hermit

Usage

From the Command Line

To use hermit from the command line, you should install it globally:

npm -g install hermit
Rendering a File
hermit filename.html
Piping an Html String

You can pipe the output of any program that produces an html string into hermit.

Example:

curl http://nodejs.org/api/assert.html | hermit

From Your Code

var hermit = require('hermit');
  , html = '<div><h3>Hello from Hermit</h3><p>A little paragraph for you</p></div>';

hermit(html, function (err, res) {
  console.log(res); 
});

Output:

Hello from Hermit           (in green)
-----------------
A little paragraph for you
Custom Options

In order to affect the way that the printed html is layed out and styled, you can pass in custom properties.

These include a stylesheet with the properties outined in the default hermit stylesheet.

var hermit = require('hermit');
  , html = '<div><h3>Hello from Hermit</h3><p>A little paragraph for you</p></div>';
  , myStylesheet = require('./path/to/my/stylesheet.js');

hermit(html, { listIndent: '    ', listStyle: '* ', stylesheet: myStylesheet }, function (err, res) {
  console.log(res); 
});

For more information a detailed example read this hermit test

Keywords

FAQs

Package last updated on 01 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc